﻿namespace Example.Creational
{
    using System;

    using Example.Creational.StaticFactory;

    using Xunit;

    public sealed class StaticFactoryFacts
    {
        [Fact]
        public void gender_empty()
        {
            Assert.Throws<ArgumentNullException>(() => Gender.FromString(string.Empty));
        }

        [Fact]
        public void gender_female()
        {
            Assert.IsType<Female>(Gender.FromString("Female"));
        }

        [Fact]
        public void gender_male()
        {
            Assert.IsType<Male>(Gender.FromString("Male"));
        }

        [Fact]
        public void gender_null()
        {
            Assert.Throws<ArgumentNullException>(() => Gender.FromString(null));
        }
    }
}